import config from "../config";
export default {
  typeFilter(val) {
    let res = ''
    switch (parseInt(val)) {
      case 0:
        res = '目录'
        break
      case 1:
        res = '菜单'
        break
      case 2:
        res = '按钮'
        break
    }
    return res
  },
  wuqStatusName(type) {
    let res = ''
    switch (type) {
      case '0':
        res = '待审核'
        break
      case '1':
        res = '审核通过'
        break
      case '2':
        res = '注销'
        break
    }
    return res
  },
  positionStatusName(type) {
    let res = ''
    switch (type) {
      case '0':
        res = '已删除'
        break
      case '1':
        res = '正常'
        break
      case '2':
        res = '招聘完成'
        break
      case '3':
        res = '已结算关闭'
        break
    }
    return res
  },

  imgPreFilter(val){

    if(val && (val.indexOf("http")===0)){
      return val
    }
    return config.imgPreUrl + val
  },

  imgListPreFilter(val){
    if(val && (val.indexOf("http")===0)){
      return val
    }
    return [config.imgPreUrl + val]
  }
}
